home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / utils / tweak16b / xintro / xintro.txt < prev   
Text File  |  1993-11-25  |  23KB  |  772 lines

  1. (HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  2.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  3.             IF WHICHVGA = 0 THEN STOP
  4.             DUMMY=RES640
  5.             SETVIEW 100, 100, 539, 379
  6.             FILLVIEW 10
  7.             WHILE INKEY$ = ""
  8.             WEND
  9.             VIDEOMODESET VMODE
  10.             END
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.                                                                          63
  28.  
  29.  
  30.  
  31.  
  32.  
  33.           FONTGETINFO
  34.  
  35.             PROTOTYPE
  36.  
  37.             SUB FONTGETINFO (Width%, Height%)
  38.  
  39.             INPUT
  40.  
  41.             no input parameters
  42.     WEND
  43.             MOUSEEXIT
  44.             VIDEOMODESET VMODE
  45.             END
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.                                                                          86
  87.  
  88.  
  89.  
  90.  
  91.  
  92.           MOUSECURSORDEFAULT
  93.  
  94.             PROTOTYPE
  95.  
  96.             SUB MOUSECURSORDEFAULT ()
  97.  
  98.             INPUT
  99.  
  100.             no input parameters
  101.  
  102.             OUTPUT
  103.  
  104.             no value returned
  105.  
  106.             USAGE
  107.  
  108.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  109.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  110. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  111. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  112. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  113. $╤
  114. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  115. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  116. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  117.       end;
  118.     end;
  119.   end;
  120.   WaitToGo;
  121. end; { UserLineStylePlay }
  122.  
  123.  
  124. procedure SayGoodbye;
  125. { Say goodbye and then exit the program }
  126. var
  127.   ViewInfo : ViewPortType;
  128. begin
  129.   MainWindow('');
  130.   GetViewSettings(ViewInfo);
  131.   SetTextStyle(TriplexFont, HorizDir, 4);
  132.   SetTextJustify(CenterText, CenterText);
  133.   with ViewInfo do
  134.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  135.   StatusLine('Press any key to quit...');
  136.   repeat until KeyPressed;
  137. end; { SayGoodbye }
  138.  
  139.  
  140. PROCEDURE SelectMode;
  141. VAR
  142.     choice1,choice2     : CHAR;
  143.    xsize,ysize            : WORD;
  144. BEGIN
  145.     (* Let's select a mode *)
  146.     ClrScr;
  147.     WriteLn('VESADEMO:');
  148.     WriteLn('1. 256 colors');
  149.     WriteLn('2. 32768 colors');
  150.     WriteLn('3. 65536 colors');
  151.     WriteLn('4. 16777216 colors');
  152.     WriteLn('Q uit');
  153.     WriteLn;
  154.     Write('Your choice: ');
  155.     REPEAT
  156.         ReadLn(choice1);
  157.       IF choice1 <> '1' THEN BEGIN
  158.           WriteLn('Sorry !');
  159.          WriteLn('This demo wasn''t written for more as 256 colors !');
  160.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  161.          WriteLn('Switching to 256 colors.');
  162.          choice1 := '1';
  163.       END;
  164.     UNTIL choice1 IN ['1'..'4','q'];
  165.     IF choice1 = 'q' THEN Halt;
  166.  
  167.     WriteLn;
  168.     WriteLn;
  169.     WriteLn('a. 320x200');
  170.     WriteLn('b. 640x480');
  171.     WriteLn('c. 800x600');
  172.     WriteLn('d. 1024x768');
  173.     WriteLn('e. 1280x1024');
  174.     WriteLn('Q uit');
  175.     WriteLn;
  176.     Write('Your choice: ');
  177.     REPEAT
  178.         ReadLn(choice2);
  179.     UNTIL choice2 IN ['a'..'e','q'];
  180.     IF choice2 = 'q' THEN Halt;
  181.  
  182.     CASE choice2 OF
  183.         'a' : BEGIN
  184.             xsize := 320;
  185.             ysize := 200;
  186.         END;
  187.         'b' : BEGIN
  188.             xsize := 640;
  189.             ysize := 480;
  190.         END;
  191.         'c' : BEGIN
  192.             xsize := 800;
  193.             ysize := 600;
  194.         END;
  195.         'd' : BEGIN
  196.             xsize := 1024;
  197.             ysize := 768;
  198.         END;
  199.         'e' : BEGIN
  200.             xsize := 1280;
  201.             ysize := 1024;
  202.         END;
  203.     END;
  204.     CASE choice1 OF
  205.         '1' : mode := FindVesaMode(xsize,ysize,8);
  206.         '2' : mode := FindVesaMode(xsize,ysize,15);
  207.         '3' : mode := FindVesaMode(xsize,ysize,16);
  208.         '4' : mode := FindVesaMode(xsize,ysize,24);
  209.     END;
  210.     IF mode = 0 THEN BEGIN
  211.         WriteLn('No such mode could be found !');
  212.         WriteLn('Switching to to 320x200.');
  213.         ReadKey;
  214.         mode := V320x200x256;
  215.     END;
  216. END;
  217.  
  218. begin { program body }
  219.   SelectMode;
  220.   Initialize;
  221.   ReportStatus;
  222.  
  223. {  AspectRatioPlay; }
  224.   FillEllipsePlay;
  225.   SectorPlay;
  226.   WriteModePlay;
  227.  
  228.   ColorPlay;
  229.   { PalettePlay only intended to work on these drivers: }
  230.   if (GraphDriver = EGA) or
  231.       (GraphDriver = EGA64) or
  232.       (GraphDriver = VGA) then
  233.      PalettePlay;
  234.   PutPixelPlay;
  235. {  PutImagePlay; }
  236.   RandBarPlay;
  237.   BarPlay;
  238.   Bar3DPlay;
  239.   ArcPlay;
  240.   CirclePlay;
  241.   PiePlay;
  242.   LineToPlay;
  243.   LineRelPlay;
  244. {  LineStylePlay; }
  245. {  UserLineStylePlay; }
  246.   TextDump;
  247.   TextPlay;
  248.   CrtModePlay;
  249.   FillStylePlay;
  250.   FillPatternPlay;
  251.   PolyPlay;
  252.   SayGoodbye;
  253. {  CloseGraph; }
  254.   CloseVesa;
  255. end.
  256. ***************************************************
  257.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  258.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  259. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  260. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  261.     Color := RandColor;
  262.     SetColor(Color);
  263.     SetFillStyle(Random(CloseDotFill)+1, Color);
  264.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  265.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  266.   until KeyPressed;
  267.   WaitToGo;
  268. end; { RandBarPlay }
  269.  
  270. procedure ArcPlay;
  271. { Draw random arcs on the screen }
  272. var
  273.   MaxRadius : word;
  274.   EndAngle : word;
  275.   ArcInfo : ArcCoordsType;
  276. begin
  277.   MainWindow('Arc / GetArcCoords demonstration');
  278.   StatusLine('Esc aborts or press a key');
  279.   MaxRadius := MaxY div 10;
  280.   repeat
  281.     SetColor(RandColor);
  282.     EndAngle := Random(360);
  283.     SetLineStyle(SolidLn, 0, NormWidth);
  284.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  285.     GetArcCoords(ArcInfo);
  286.     with ArcInfo do
  287.     begin
  288.       Line(X, Y, XStart, YStart);
  289.       Line(X, Y, Xend, Yend);
  290.     end;
  291.   until KeyPressed;
  292.   WaitToGo;
  293. end; { ArcPlay }
  294.  
  295. procedure PutPixelPlay;
  296. { Demonstrate the PutPixel and GetPixel commands }
  297. const
  298.   Seed   = 1962; { A seed for the random number generator }
  299.   NumPts = 2000; { The number of pixels plotted }
  300.   Esc    = #27;
  301. var
  302.   I : word;
  303.   X, Y, Color : word;
  304.   XMax, YMax  : integer;
  305.   ViewInfo    : ViewPortType;
  306. begin
  307.   MainWindow('PutPixel / GetPixel demonstration');
  308.   StatusLine('Esc aborts or press a key...');
  309.  
  310.   GetViewSettings(ViewInfo);
  311.   with ViewInfo do
  312.   begin
  313.     XMax := (x2-x1-1);
  314.     YMax := (y2-y1-1);
  315.   end;
  316.  
  317.   while not KeyPressed do
  318.   begin
  319.     { Plot random pixels }
  320.     RandSeed := Seed;
  321.     I := 0;
  322.     while (not KeyPressed) and (I < NumPts) do
  323.     begin
  324.       Inc(I);
  325.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  326.     end;
  327.  
  328.     { Erase pixels }
  329.     RandSeed := Seed;
  330.     I := 0;
  331.     while (not KeyPressed) and (I < NumPts) do
  332.     begin
  333.       Inc(I);
  334.       X := Random(XMax)+1;
  335.       Y := Random(YMax)+1;
  336.       Color := GetPixel(X, Y);
  337.         if Color = RandColor then
  338.           PutPixel(X, Y, 0);
  339.      end;
  340.   end;
  341.   WaitToGo;
  342. end; { PutPixelPlay }
  343.  
  344. procedure PutImagePlay;
  345. { Demonstrate the GetImage and PutImage commands }
  346.  
  347. const
  348.   r  = 20;
  349.   StartX = 100;
  350.   StartY = 50;
  351.  
  352. var
  353.   CurPort : ViewPortType;
  354.  
  355. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  356. var
  357.   Step : integer;
  358. begin
  359.   Step := Random(2*r);
  360.   if Odd(Step) then
  361.     Step := -Step;
  362.   X := X + Step;
  363.   Step := Random(r);
  364.   if Odd(Step) then
  365.     Step := -Step;
  366.   Y := Y + Step;
  367.  
  368.   { Make saucer bounce off viewport walls }
  369.   with CurPort do
  370.   begin
  371.     if (x1 + X + Width - 1 > x2) then
  372.       X := x2-x1 - Width + 1
  373.     else
  374.       if (X < 0) then
  375.         X := 0;
  376.     if (y1 + Y + Height - 1 > y2) then
  377.       Y := y2-y1 - Height + 1
  378.     else
  379.       if (Y < 0) then
  380.         Y := 0;
  381.   end;
  382. end; { MoveSaucer }
  383.  
  384. var
  385.   Pausetime : word;
  386.   Saucer    : pointer;
  387.   X, Y      : integer;
  388.   ulx, uly  : word;
  389.   lrx, lry  : word;
  390.   Size      : word;
  391.   I         : word;
  392. begin
  393.   ClearDevice;
  394.   FullPort;
  395.  
  396.   { PaintScreen }
  397.   ClearDevice;
  398.   MainWindow('GetImage / PutImage Demonstration');
  399.   StatusLine('Esc aborts or press a key...');
  400.   GetViewSettings(CurPort);
  401.  
  402.   { DrawSaucer }
  403.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  404.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  405.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  406.   Circle(StartX+10, StartY-12, 2);
  407.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  408.   Circle(StartX-10, StartY-12, 2);
  409.   SetFillStyle(SolidFill, MaxColor);
  410.   FloodFill(StartX+1, StartY+4, GetColor);
  411.  
  412.   { ReadSaucerImage }
  413.   ulx := StartX-(r+1);
  414.   uly := StartY-14;
  415.   lrx := StartX+(r+1);
  416.   lry := StartY+(r div 3)+3;
  417.  
  418.   Size := ImageSize(ulx, uly, lrx, lry);
  419.   GetMem(Saucer, Size);
  420.   GetImage(ulx, uly, lrx, lry, Saucer^);
  421. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  422.  
  423.   { Plot some "stars" }
  424.   for I := 1 to 1000 do
  425.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  426.   X := MaxX div 2;
  427.   Y := MaxY div 2;
  428.   PauseTime := 70;
  429.  
  430.   { Move the saucer around }
  431.   repeat
  432. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  433.      Delay(PauseTime);
  434. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  435.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  436.   until KeyPressed;
  437.   FreeMem(Saucer, size);
  438.   WaitToGo;
  439. end; { PutImagePlay }
  440.  
  441. procedure PolyPlay;
  442. { Draw random polygons with random fill styles on the screen }
  443. const
  444.   MaxPts = 5;
  445. type
  446.   PolygonType = array[1..MaxPts] of PointType;
  447. var
  448.   Poly : PolygonType;
  449.   I, Color : word;
  450. begin
  451.   MainWindow('FillPoly demonstration');
  452.   StatusLine('Esc aborts or press a key...');
  453.   repeat
  454.     Color := RandColor;
  455.     SetFillStyle(Random(11)+1, Color);
  456.     SetColor(Color);
  457.     for I := 1 to MaxPts do
  458.       with Poly[I] do
  459.       begin
  460.         X := Random(MaxX);
  461.         Y := Random(MaxY);
  462.       end;
  463.     FillPoly(MaxPts, Poly);
  464.   until KeyPressed;
  465.   WaitToGo;
  466. end; { PolyPlay }
  467.  
  468. procedure FillStylePlay;
  469. { Display all of the predefined fill styles available }
  470. var
  471.   Style    : word;
  472.   Width    : word;
  473.   Height   : word;
  474.   X, Y     : word;
  475.   I, J     : word;
  476.   ViewInfo : ViewPortType;
  477.  
  478. procedure DrawBox(X, Y : word);
  479. begin
  480.   SetFillStyle(Style, MaxColor);
  481.   with ViewInfo do
  482.     Bar(X, Y, X+Width, Y+Height);
  483.   Rectangle(X, Y, X+Width, Y+Height);
  484.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  485.   Inc(Style);
  486. end; { DrawBox }
  487.  
  488. begin
  489.   MainWindow('Pre-defined fill styles');
  490.   GetViewSettings(ViewInfo);
  491.   with ViewInfo do
  492.   begin
  493.     Width := 2 * ((x2+1) div 13);
  494.     Height := 2 * ((y2-10) div 10);
  495.   end;
  496.   X := Width div 2;
  497.   Y := Height div 2;
  498.   Style := 0;
  499.   for J := 1 to 3 do
  500.   begin
  501.     for I := 1 to 4 do
  502.     begin
  503.       DrawBox(X, Y);
  504.       Inc(X, (Width div 2) * 3);
  505.     end;
  506.     X := Width div 2;
  507.     Inc(Y, (Height div 2) * 3);
  508.   end;
  509.   SetTextJustify(LeftText, TopText);
  510.   WaitToGo;
  511. end; { FillStylePlay }
  512.  
  513. procedure FillPatternPlay;
  514. { Display some user defined fill patterns }
  515. const
  516.   Patterns : array[0..11] of FillPatternType = (
  517.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  518.             OldColor which has a path of pixels of OldColor or NewColor
  519.             with sides touching back to the seed point, (XSeed, YSeed).
  520.             Therefore, only pixels of OldColor are modified and no other
  521.             information is changed.
  522.  
  523.             SEE ALSO
  524.  
  525.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  526.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  527.             SETVIEW
  528.  
  529.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  530.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  531.             IF WHICHVGA = 0 THEN STOP
  532.             DUMMY=RES640
  533.             SETVIEW 100, 100, 539, 379
  534.             FILLVIEW 10
  535.             WHILE INKEY$ = ""
  536.             WEND
  537.             VIDEOMODESET VMODE
  538.             END
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.                                                                          63
  556.  
  557.  
  558.  
  559.  
  560.  
  561.           FONTGETINFO
  562.  
  563.             PROTOTYPE
  564.  
  565.             SUB FONTGETINFO (Width%, Height%)
  566.  
  567.             INPUT
  568.  
  569.             no input parameters
  570.     WEND
  571.             MOUSEEXIT
  572.             VIDEOMODESET VMODE
  573.             END
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.                                                                          86
  615.  
  616.  
  617.  
  618.  
  619.  
  620.           MOUSECURSORDEFAULT
  621.  
  622.             PROTOTYPE
  623.  
  624.             SUB MOUSECURSORDEFAULT ()
  625.  
  626.             INPUT
  627.  
  628.             no input parameters
  629.  
  630.             OUTPUT
  631.  
  632.             no value returned
  633.  
  634.             USAGE
  635.  
  636.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  637.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  638. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  639. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  640. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  641. $╤
  642. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  643. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  644. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  645.       end;
  646.     end;
  647.   end;
  648.   WaitToGo;
  649. end; { UserLineStylePlay }
  650.  
  651.  
  652. procedure SayGoodbye;
  653. { Say goodbye and then exit the program }
  654. var
  655.   ViewInfo : ViewPortType;
  656. begin
  657.   MainWindow('');
  658.   GetViewSettings(ViewInfo);
  659.   SetTextStyle(TriplexFont, HorizDir, 4);
  660.   SetTextJustify(CenterText, CenterText);
  661.   with ViewInfo do
  662.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  663.   StatusLine('Press any key to quit...');
  664.   repeat until KeyPressed;
  665. end; { SayGoodbye }
  666.  
  667.  
  668. PROCEDURE SelectMode;
  669. VAR
  670.     choice1,choice2     : CHAR;
  671.    xsize,ysize            : WORD;
  672. BEGIN
  673.     (* Let's select a mode *)
  674.     ClrScr;
  675.     WriteLn('VESADEMO:');
  676.     WriteLn('1. 256 colors');
  677.     WriteLn('2. 32768 colors');
  678.     WriteLn('3. 65536 colors');
  679.     WriteLn('4. 16777216 colors');
  680.     WriteLn('Q uit');
  681.     WriteLn;
  682.     Write('Your choice: ');
  683.     REPEAT
  684.         ReadLn(choice1);
  685.       IF choice1 <> '1' THEN BEGIN
  686.           WriteLn('Sorry !');
  687.          WriteLn('This demo wasn''t written for more as 256 colors !');
  688.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  689.          WriteLn('Switching to 256 colors.');
  690.          choice1 := '1';
  691.       END;
  692.     UNTIL choice1 IN ['1'..'4','q'];
  693.     IF choice1 = 'q' THEN Halt;
  694.  
  695.     WriteLn;
  696.     WriteLn;
  697.     WriteLn('a. 320x200');
  698.     WriteLn('b. 640x480');
  699.     WriteLn('c. 800x600');
  700.     WriteLn('d. 1024x768');
  701.     WriteLn('e. 1280x1024');
  702.     WriteLn('Q uit');
  703.     WriteLn;
  704.     Write('Your choice: ');
  705.     REPEAT
  706.         ReadLn(choice2);
  707.     UNTIL choice2 IN ['a'..'e','q'];
  708.     IF choice2 = 'q' THEN Halt;
  709.  
  710.     CASE choice2 OF
  711.         'a' : BEGIN
  712.             xsize := 320;
  713.             ysize := 200;
  714.         END;
  715.         'b' : BEGIN
  716.             xsize := 640;
  717.             ysize := 480;
  718.         END;
  719.         'c' : BEGIN
  720.             xsize := 800;
  721.             ysize := 600;
  722.         END;
  723.         'd' : BEGIN
  724.             xsize := 1024;
  725.             ysize := 768;
  726.         END;
  727.         'e' : BEGIN
  728.             xsize := 1280;
  729.             ysize := 1024;
  730.         END;
  731.     END;
  732.     CASE choice1 OF
  733.         '1' : mode := FindVesaMode(xsize,ysize,8);
  734.         '2' : mode := FindVesaMode(xsize,ysize,15);
  735.         '3' : mode := FindVesaMode(xsize,ysize,16);
  736.         '4' : mode := FindVesaMode(xsize,ysize,24);
  737.     END;
  738.     IF mode = 0 THEN BEGIN
  739.         WriteLn('No such mode could be found !');
  740.         WriteLn('Switching to to 320x200.');
  741.         ReadKey;
  742.         mode := V320x200x256;
  743.     END;
  744. END;
  745.  
  746. begin { program body }
  747.   SelectMode;
  748.   Initialize;
  749.   ReportStatus;
  750.  
  751. {  AspectRatioPlay; }
  752.   FillEllipsePlay;
  753.   SectorPlay;
  754.   WriteModePlay;
  755.  
  756.   ColorPlay;
  757.   { PalettePlay only intended to work on these drivers: }
  758.   if (GraphDriver = EGA) or
  759.       (GraphDriver = EGA64) or
  760.       (GraphDriver = VGA) then
  761.      PalettePlay;
  762.   PutPixelPlay;
  763. {  PutImagePlay; }
  764.   RandBarPlay;
  765.   BarPlay;
  766.   Bar3DPlay;
  767.   ArcPlay;
  768.   CirclePlay;
  769.   PiePlay;
  770.   LineToPlay;
  771.   LineRelPlay;
  772.